package com.ftg.learn.chapter15.factorypattern;

import com.ftg.learn.chapter15.factorypattern.color.ColorFactory;
import com.ftg.learn.chapter15.factorypattern.shape.ShapeFacotry;

/**
 * @author KangJx
 * @date 2021/7/28
 */
public class AstractFactoryProduce {

    /**
     * 这个方法是用来获取抽象工厂
     * lv 返回相应的工厂
     * @param lv 类型
     * @return
     */
    public static AbstractFactory getAbstractFactory(FactoryLv lv){
        if(lv.equals(FactoryLv.SHAPE)){
            return new ShapeFacotry();
        }else if(lv.equals(FactoryLv.COLOR)){
            return new ColorFactory();
        }
        return null;
    }

}
